home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / pc_board / sendcom.zip / MYFILE.CPP < prev    next >
C/C++ Source or Header  |  1991-10-14  |  819b  |  34 lines

  1. #include <fcntl.h>
  2. #include <io.h>                
  3. #include <stdio.h>
  4.  
  5. #include "myfile.h"
  6.  
  7. //:::::::::::::::[ CLASS myfile MEMBER DECLARATIONS ]:::::::::::::::::::::::
  8.  
  9. // CONSTRUCTOR (CURRENTLY NOT USED, SET UP FOR FUTURE PURPOSES)
  10. //
  11. myfile::myfile(){
  12.         handle=-1;
  13. }
  14.  
  15. // OPEN FILE AND RETURN STATUS (0=GOOD  -1=ERROR)
  16. // BY DEFAULT ONLY PATHNAME IS REQUIRED.  IF NO ACCESS OR MODE IS SPECIFIED
  17. // mopen WILL USE int mopen(pathname, O_RDONLY|O_BINARY|O_DENYNONE, 0)
  18. //
  19. int myfile::mopen(const char *path, int access, int mode){
  20.         if ((handle = open(path, access, mode))==-1){
  21.                 perror("Error:");
  22.                 return(handle);
  23.         }
  24.         return(0);
  25. }
  26.  
  27. // CLOSE FILE PREVIOUSLY OPENED WITH mopen()
  28. //
  29. void myfile::mclose(){
  30.         close(handle);
  31. }
  32.  
  33.  
  34.